<!--
 * @Author: your name
 * @Date: 2021-11-12 14:24:53
 * @LastEditTime: 2021-11-12 14:32:14
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue-note\day02\09.v-text和v-html.html
-->
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>09.v-text和v-html</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <p>{{msg}}</p>
      <!-- 相同点：会将标签间的原有内容给覆盖掉 -->
      <!-- v-text会将数据当成普通的字符串，给渲染到页面上 -->
      <div v-text="link">textContext</div>
      <!-- v-html会将渲染的数据识别成对应的标签并渲染到页面 -->
      <div v-html="link">innerHTML</div>
    </div>
    </div>
    <script>
      new Vue({
        el: "#app",
        data: {
          msg: "hello",
          link: '<a href="http://www.atguigu.com">尚硅谷</a>',
        },
      });
    </script>
  </body>
</html>
